<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<%@ taglib uri="/WEB-INF/displaytag-11.tld" prefix="display"%>
<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>RegistrarGrupoFamiliar</title>
    <link href="../../css/jdeveloper.css" rel="stylesheet" media="screen"/>
    <link href="<%= request.getContextPath() + "/css/bloques.css" %>" rel="stylesheet" type="text/css">
    
    <script language="javascript">
      
      function Retornar()
      {
        document.frmRegistrarGrupo.action = '<%=request.getContextPath()%>'+'/beneficiarios/VerGrupoFamiliar.do';
        document.frmRegistrarGrupo.submit(); 
      }
    </script>
    
  </head>
  <body>
  <script src="<%=request.getContextPath()%>/js/displaytag.js" type="text/javascript"></script>
  <form name="frmRegistrarGrupo" method="get" action="<%= request.getContextPath()+"/beneficiarios/Buscar.do"%>" >
    <table cellspacing="3" cellpadding="2" border="0" width="70%" align="center">
      <tr>
        <td colspan="3"  class="titulosenblanco">
          <DIV align="center">
            <STRONG>Registrar Grupo Familiar</STRONG>
          </DIV>
        </td>
      </tr>
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      <logic:present name="ListBeneSelected">
        <logic:iterate id="bene" length="1" name="ListBeneSelected" scope="request">
        <tr>
          <td width="18%" class="celdatabla">
            <STRONG>Beneficiario:</STRONG>
          </td>
          <td width="40%">
            <div class="form">
              <bean:write name="bene" property="numeroDocumento"/>
              <bean:write name="bene" property="nombre1"/>
              <bean:write name="bene" property="nombre2"/>
              <bean:write name="bene" property="primerApellido"/>
              <bean:write name="bene" property="segundoApellido"/>
            </div>
          </td>
          <td width="20%">&nbsp;</td>
        </tr>
        </logic:iterate>
      </logic:present>
      <tr>
        <td colspan="3">&nbsp;</td>
      </tr>
      
    </table>
    
    <logic:present name="msgerror">
        <DIV align="left" class="celdatabla"><strong><%=session.getAttribute("msgerror")%></strong></DIV>
        <%session.removeAttribute("msgerror");%>
    </logic:present>
    <logic:present name="msgasignar">
        <DIV align="left" class="celdatabla"><strong><%=session.getAttribute("msgasignar")%></strong></DIV>
        <%session.removeAttribute("msgasignar");%>
    </logic:present>
    
    <logic:notPresent name="msgerror">
      <logic:present name="ListBeneInsert">
        <table  cellspacing="3" cellpadding="2" border="0" width="60%" align="center">
          <tr>
            <td class="titulosenblanco" align="center">
              Los siguientes Beneficiarios fueron asignados al Grupo Familiar
            </td>
          </tr>
          <tr>
            <td></td>
          </tr>
          <tr>
            <td>
              <display:table name="ListBeneInsert" pagesize="20" id="BeneInsert" class="bordesTable"  cellpadding="3" cellspacing="1" style="width:100%" >
                  <display:column headerClass="headerTable" title="Documento" class="Numero" sortable="true" >
                      <div align="center"><bean:write name="BeneInsert" property="numeroDocumento"/></div> 
                  </display:column>
                  <display:column headerClass="headerTable" title="Nombres y Apellidos" class="Numero" sortable="false">
                      <bean:write name="BeneInsert" property="nombre1"/> <bean:write name="BeneInsert" property="nombre2"/> <bean:write name="BeneInsert" property="primerApellido"/> <bean:write name="BeneInsert" property="segundoApellido"/>
                  </display:column>
              </display:table>
            </td>
          </tr>
        </table>
      </logic:present>
    </logic:notPresent>
    <p>&nbsp;</p>
    <logic:present name="ListBeneNoInsert">
        <table  cellspacing="3" cellpadding="2" border="0" width="60%" align="center">
          <tr>
            <td class="titulosenblanco" align="center">
              Los siguientes Beneficiarios no fueron asignados al Grupo Familiar
            </td>
          </tr>
          <tr>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>
              <P></P>
              <display:table name="ListBeneNoInsert" pagesize="20" id="BeneNoInsert" class="bordesTable"  cellpadding="3" cellspacing="1" style="width:100%" >
                  <display:column headerClass="headerTable" title="Documento" class="Numero" sortable="true">
                      <div align="center"><bean:write name="BeneNoInsert" property="numeroDocumento"/></div>
                  </display:column>
                  <display:column headerClass="headerTable" title="Nombres y Apellidos" class="Numero" sortable="false">
                      <bean:write name="BeneNoInsert" property="nombre1"/> <bean:write name="BeneNoInsert" property="nombre2"/> <bean:write name="BeneNoInsert" property="primerApellido"/> <bean:write name="BeneNoInsert" property="segundoApellido"/>
                  </display:column>
              </display:table>
            </td>
          </tr>
        </table>
      </td>
    </logic:present>
    
    <table  cellspacing="3" cellpadding="2" border="0" width="60%" align="center">
      <tr>
        <td>
          <%
            String strReturn = (String)request.getAttribute("Return");
            if(strReturn == null)
            {
          %>
              <DIV align="center">
                <input type="SUBMIT" value="Siguiente"/>
              </DIV>
          <%
            }else{
          %>
            <logic:present name="ListBeneSelected">
              <logic:iterate id="bene" length="1" name="ListBeneSelected" scope="request">
                <DIV align="center">
                  <input type="HIDDEN" name="code" value="<bean:write name="bene" property="code"/>"/>
                  <input type="button" value="Siguiente" language="javascript" onclick="Retornar()"/>
                </DIV>
              </logic:iterate>
            </logic:present>
            <logic:notPresent name="ListBeneSelected">
            <table cellspacing="3" cellpadding="2" border="0" width="50%" align="center">
              <tr>
                <td align="right">
                  <input type="SUBMIT" value="Siguiente"/>
                </td>
              </tr>
            </table>
            </logic:notPresent>
          <%
            }
          %>
        </td>
      </tr>
    </table>
  </form>
  </body>
</html>
